import {defineStore} from 'pinia'
import { ref } from 'vue'

//ai模块
export const useAIStore = defineStore('ai', () => {
  const aiChatBoxSwitch = ref(true)
  const talkID = ref(null)
  const talkList = ref([])
  const historyTalkList = ref([])
  const historyTalkListRefreshStatus = ref(false)

  //控制ChatBanner显示
  const setAIChatBoxSwitch = (newValue)=>{aiChatBoxSwitch.value = newValue}

  //当前对话的talkID参数
  const setTalkID = (newValue)=>{talkID.value = newValue}
  // 对话的具体信息
  const setTalkList = (newValue)=>{talkList.value = newValue}
  // 历史对话信息
  const setHistoryTalkList = (newValue)=>{historyTalkList.value = newValue}
  // 历史对话信息刷新状态
  const setHistoryTalkListRefreshStatus = (newValue)=>{historyTalkListRefreshStatus.value = newValue}

  return {
    aiChatBoxSwitch,
    talkID,
    talkList,
    historyTalkList,
    historyTalkListRefreshStatus,
    setAIChatBoxSwitch,
    setTalkID,
    setTalkList,
    setHistoryTalkList,
    setHistoryTalkListRefreshStatus,
  }
})
